package br.com.game.controle.niveis;

import java.awt.Color;

import br.com.engine.Vector2;
import br.com.engine.componentes.Animator;
import br.com.engine.componentes.GameObject;
import br.com.engine.componentes.Scene;
import br.com.engine.componentes.Sprite;
import br.com.engine.componentes.SpriteFont;
import br.com.engine.componentes.factory.SpriteFontFactory;
import br.com.engine.main.Executor;

public class TesteNewSpriteAnimator extends Scene
{
	GameObject obj;
	
	public static void main(String[] args) {
		Executor.loadGame( );
	}
	
	@Override
	public void setup() 
	{
		super.setup( );
		
		obj = new GameObject( );
		
		Sprite sp = new Sprite( "Person" );
		obj.addComponente( sp );
		
		obj.addScripts(  time ->
		{
			Vector2 position = obj.getPosition( );
			
			position.setPositionPixel( position.getPositionPixel( ).x + 1, position.getPositionPixel( ).y + 1 );
		} );

		Animator animator = new Animator( obj, 2, 1, 0, 100 );
		animator.creatAnimation( "down", 0, 1 );
		animator.play( "down" );
		
		add( obj );
		
		GameObject font  = SpriteFontFactory.newSpriteFont( "Teste Factory", new Vector2( 0, 0 )                  );
		GameObject font2 = SpriteFontFactory.newSpriteFont( "Teste Factory", 50, Color.RED, 15, SpriteFont.ITALIC );
		
		add( font  );
		add( font2 );
	}
}